Skip to content

Export various fields and structures #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 11, 2020

Conversation

devrandom
Copy link
Member

@devrandom devrandom commented Aug 2, 2020

This is for discussion purposes at this time. This is a set of patches we maintain on top of master in order to let Rust Lightning Signer do various things, including:

  • access to TxCreationKeys fields and constructor, so that we can use it to call various InMemoryChannelKeys methods
  • access to LocalCommitmentTransaction constructor for InMemoryChannelKeys use
  • export the unsafe methods for testing use, gated by a new feature named "unsafe"
  • access to node and channel announcement fields so that the contents can be checked by the signer

@codecov
Copy link

codecov bot commented Aug 2, 2020

Codecov Report

Merging #662 into master will decrease coverage by 0.00%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #662      +/-   ##
==========================================
- Coverage   91.36%   91.35%   -0.01%     
==========================================
  Files          35       35              
  Lines       21681    21688       +7     
==========================================
+ Hits        19808    19813       +5     
- Misses       1873     1875       +2     
Impacted Files Coverage Δ
lightning/src/chain/keysinterface.rs 95.04% <ø> (ø)
lightning/src/ln/channelmonitor.rs 95.70% <ø> (ø)
lightning/src/ln/onchaintx.rs 93.94% <ø> (ø)
lightning/src/util/enforcing_trait_impls.rs 100.00% <ø> (ø)
lightning/src/ln/chan_utils.rs 95.97% <75.00%> (-0.28%) ⬇️
lightning/src/ln/functional_tests.rs 97.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22a0dd5...fd2db40. Read the comment docs.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly questions about use-cases.

Copy link

@ariard ariard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart of unsafe feature in discussion, Concept ACK

@devrandom devrandom marked this pull request as draft August 5, 2020 06:47
@devrandom devrandom changed the title WIP: export various fields and structures Draft: export various fields and structures Aug 5, 2020
@devrandom devrandom marked this pull request as ready for review August 8, 2020 17:06
@devrandom devrandom changed the title Draft: export various fields and structures Export various fields and structures Aug 8, 2020
@devrandom
Copy link
Member Author

Removed message field visibility change - will be a separate PR.

Added more detailed commit messaging and removed the draft marker.

TheBlueMatt
TheBlueMatt previously approved these changes Aug 8, 2020
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this as-is, though I think we need to newtype TxCreationKeys because the APi definitely encourages "unsafe trusting" of the in-RL-derived keys when doing external signing.

I'd prefer a more descriptive name over unsafe, though. Maybe unsafe_revoked_tx_generation or something?

@devrandom
Copy link
Member Author

devrandom commented Aug 9, 2020

I renamed unsafe to unsafe_revoked_tx_signing.

I think the PreCalculatedTxCreationKeys change should go in a separate PR, because the changes (especially involving LocalCommitmentTransaction) will dwarf the other things in this PR. The PreCalculatedTxCreationKeys changes ended up smaller that I predicted, please take a look at #664.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except for new_missing_local_sig, which could use a bit of clean up if its going to be pub.

Allows unsafe signing in dev code, such as functional testing of
justice transactions outside our crate.
Allows calling of InMemoryChannelKeys methods
@devrandom devrandom force-pushed the compat5 branch 2 times, most recently from f05076d to 8bcdc87 Compare August 11, 2020 08:48
@TheBlueMatt TheBlueMatt merged commit 1d2d393 into lightningdevkit:master Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants